<!DOCTYPE html>
<html lang="ch">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=\, initial-scale=1.0">
    <title>Document</title>
    <style>

        *{
            margin: 0;
            padding: 0;
        }
        .box{
            width: 400px;
            height: 400px;
            background-color: aqua;
            margin: 0 auto;
            position: relative;

            /* 父选择相对定位 */
        }

        .child{
            width: 100px;
            height: 100px;
            background-color: brown;
            left: 100px;
            top: 100px;
            position: absolute;
        }

        /* 子盒子设置为绝对定位   */

    </style>
</head>
<body>
        <div class="box">

            <div class="child"></div>

        </div>
</body>
</html>